﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Easydp.Models;
using System.ComponentModel;
namespace Easydp.Controllers
{
    [DataObject()]
   public class TrainRouteController
    {
       TrainRouteManager dal = new TrainRouteManager();

       [DataObjectMethod(DataObjectMethodType.Select)]
       public List<Easydp.Models.Entities.TT_TrainRoute> Search(string sStation, string eStation)
       {
           if (string.IsNullOrEmpty(sStation) || string.IsNullOrEmpty(eStation))
               return null;
           return dal.SearchByStationName(sStation, eStation);
       }
       
       [DataObjectMethod(DataObjectMethodType.Select)]
       public List<Easydp.Models.Entities.TT_TrainRoute> Search(string trainNumber)
       {
           if (string.IsNullOrEmpty(trainNumber))
               return null;
           return dal.SearchByTrainNumber(trainNumber);
       }
    }
}
